#version 430 core

uniform sampler2D colorTex;
uniform sampler2DShadow depthTex;

in vec4 ShadowCoord;

out vec4 FragColor;

void main()
{
	// 从裁剪空间变换到 NDC
	vec3 Shadow = ShadowCoord.xyz / ShadowCoord.w; // ShadowCoord 为齐次空间坐标
	FragColor  = texture(colorTex, Shadow.xy);

	// 渲染阴影
	//float f = textureProj(depthTex, ShadowCoord);
	//FragColor  = texture(colorTex, Shadow.xy) * f;
}